
enum FUN_LIST {
    //% block="温度(℃)"
     readTemperature,
    //% block="气压(pa)"
     readPressure,
    //% block="高度(m)"
     readAltitude
}



//% color="#5ba55b" iconWidth=50 iconHeight=40
namespace HP203B_Sensor { 

    //% block="读取数字温度气压传感器的 [FUN]" blockType="reporter"
    //% FUN.shadow="dropdown" FUN.options="FUN_LIST" 
     export function read_hp203(parameter: any, block: any) {
        let fun = parameter.FUN.code;
        Generator.addInclude('#include_Wire_h>', '#include <Wire.h>');
        Generator.addInclude('#include_HP203B_h', '#include "HP203B.h"');
        Generator.addObject(`AHTxx_aht`, `HP203B `, `myHP203;`);
        Generator.addSetup(`myHP203_begin`, `myHP203.begin();`);
        Generator.addCode(`myHP203.${fun}()`);
    }

   
}
